﻿using NMortgage.UI.ViewModels;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using Caliburn.Micro;
using NMortgage.UI.Model;

namespace NMortgage.UI.Tests
{

    [TestClass()]
    public class ExtraPaymentListViewModelTest : TestBase<ExtraPaymentListViewModel>
    {
        [TestInitialize]
        public void Init()
        {
            Subject = new ExtraPaymentListViewModel(new EventAggregator());
        }

        [TestMethod()]
        public void ExtraPaymentListViewModelConstructorTest()
        {
            IEventAggregator eventAggregator = new EventAggregator();
            ExtraPaymentListViewModel target = new ExtraPaymentListViewModel(eventAggregator);
            Assert.IsNotNull(target);
        }

        [TestMethod()]
        public void AddTest()
        {
            Subject.Add();
            var dialog = Subject.ItemDialog;
            Assert.IsInstanceOfType(dialog,typeof(ExtraPaymentViewModel));
        }

        [TestMethod()]
        public void EditTest()
        {
            Subject.Edit(null);
            var dialog = Subject.ItemDialog;
            Assert.IsInstanceOfType(dialog, typeof(ExtraPaymentViewModel));
        }

        [TestMethod()]
        public void TitleTest()
        {
            string actual;
            actual = Subject.Title;
            Assert.IsFalse(string.IsNullOrEmpty(actual));
        }
    }
}
